Machine tool displacement correcting apparatus

ABSTRACT

A history of function values of a spindle rotation frequency in each time period from present to past is stored in a data table  22 D and corrective coefficients are stored in advance in a corrective coefficient table  22 C relating the coefficients to the location in the data table  22 D. Each location and corrective coefficient are read out from the corrective coefficient table  22 C and the function value of the spindle rotation frequency corresponding to the location is read out from the data table  22 D. The compensation value is calculated from the total sum of each product of the function value and the corrective coefficient in each location and compensate the NC command position with the compensation value.

TECHNICAL FIELD

The present invention relates to a displacement compensation apparatusfor machine tools to compensate displacement resulting from centrifugalforce and heat generation caused by spindle rotation in a machine tool.

BACKGROUND ART

Conventionally, an apparatus to compensate heat displacement of aspindle based on temperature changes on the spindle is known as a heatdisplacement compensation apparatus to compensate heat displacementresulting from heat generation caused by rotation of the spindle in themachine tool.

In the above displacement compensation apparatus, compensation acorrelation between the displacement of the spindle and a difference intemperature between places where a heat displacement is most likely tooccur and where change in temperature is relatively small is examined inadvance, for instance, a difference in temperature between near thespindle and the bed. A compensation value corresponding to thedifference in temperature is calculated from the correlation, and theheat displacement is compensated based on the compensation value. Butthe conventional compensation method of heat displacement has adisadvantage that a difference is often found between an actual heatdisplacement of a spindle and a compensation value derived from thecompensation calculation based on the difference in temperature, whenthe spindle is rotated at a random rotation frequency.

It is clear from FIG. 8 that a large deviation is found between ameasured value and a compensation value obtained from the conventionalcompensation calculation, when the displacement of the spindle ismeasured after the spindle is rotated at rotation frequencies of, forinstance, 1000 rpm, 3000 rpm, 0 (suspension), 2000 rpm, 3000 rpm, 1000rpm for each 40 minutes and after leaving in suspension for 120 minutes.

When a spindle rotates, the spindle is expanded by centrifugal force.There is a disadvantage that an expansion of a spindle by centrifugalforce makes the spindle shorten affected by the Poisson's effect, sothat the position of the tool retreats to that extent from the productin process.

In the conventional heat displacement compensation method, as thecompensation value is determined by the difference in temperature, it isimpossible to compensate instant displacement caused by a change in therotation frequency of the spindle.

The object of the present invention is to provide a displacementcompensation apparatus for machine tools to precisely compensatedisplacement resulting from centrifugal force or heat generation causedby rotating spindle rotation even when the spindle is randomly rotated.

DISCLOSURE OF THE INVENTION

A displacement compensation apparatus for machine tools according to thepresent invention is to compensate a displacement resulting fromcentrifugal force and heat generation caused by rotation of a spindle ina machine tool. The apparatus is provided with; a historical data tablestoring a history of function values of rotation frequency of thespindle in each time period from present to past; a correctivecoefficient table in which corrective coefficients are stored in advancerelating the coefficients to the corresponding location in thehistorical data table and a compensation process means. The compensationprocess means reads out each location and each corrective coefficientwhich corresponds to the location from the corrective coefficient tableand concurrently reads out a function value for the rotation frequencyof the spindle at the corresponding location from the historical datatable, calculates a compensation value from the function value at eachlocation and the corresponding corrective coefficient, and compensates acommanded position of each shaft in the machine tool based on thecompensation values.

The corrective coefficient is determined by collecting and storingmeasured data on displacement of the spindle, shaft rotation time dataand rotation frequency data when the spindle is randomly rotated withchanging the shaft rotation frequency and by processing a regressioncalculation based on these data.

The function value of the rotation frequency of the spindle is a valueproportional to the square of the spindle rotation frequency, or a valuebased on the proportional value to the square of the spindle rotationfrequency, with compensation by other value.

For instance, the function value is obtained from dividing a square ofthe rotation frequency of the spindle by 16384 and subtracting one tenthof the rotation frequency of the spindle. The number thus derived isused as the function value. The equation is expressed as follows.

 Functional equation=(rotation frequency×rotation frequency/16384)−0.1×rotation frequency  (1)

In another example, a function value is calculated as a square of therotation frequency of the spindle is divided by 16384 and furtherdivided by one plus a number of three times of inverse of the naturallogarithm of the rotation frequency divided by 25000. The functionalequation is expressed as follows.

Functional equation=(rotation frequency×rotationfrequency/16384/(1.0+3.0/exp(rotation frequency/25000))  (2)

In general, as centrifugal force is proportional to a square of arotation frequency of a spindle, a displacement which is proportional tocentrifugal force is also proportional to a square of the rotationfrequency of the spindle. And as long as a force acting on the spindleand a friction coefficient stay constant, the friction torque is inproportion to the rotation frequency of the spindle. As friction is aproduct of friction torque and rotation frequency, it is proportional toa square of the rotation frequency of the spindle. Heat generation is aresult of consumed energy by friction, it is also proportional to asquare of the rotation frequency of the spindle. Hence, when a valuewhich is proportional to a square of a spindle rotation frequency isused as a function value of the spindle rotation frequency, the accuracyof compensation can be improved.

In actuality, as a force acting on the spindle tends to increase withthe increase of the rotation frequency, beat generation changes moresharply than a proportion to a square of the rotation frequency of thespindle. Consequently, as a function value for the rotation frequency ofthe spindle, a number proportional to a square of the spindle rotationfrequency as a main component and compensated by another number is used.Then the accuracy of compensation is much improved.

In compensating displacement, each stored location and correctivecoefficient are read out from the corrective coefficient, concurrentlythe function value of the spindle rotation frequency in each location isread out from the historical data table. And the compensation value iscalculated from the function value in each location and thecorresponding corrective coefficient.

Now, each location which is read out from the corrective coefficienttable is taken as k₀₀, k₀₁, k₀₂, . . . k_(m), and corresponding eachcorrective coefficient as b₀₀, b₀₁, b₀₂, . . . b_(m). And the functionvalue of the spindle rotation frequency at each location read out fromthe historical data table is taken as R(k₀₀), R(k₀₁), R(k₀₂), . . .R(k_(m)), then the displacement amounts δ is calculated from thefollowing equation.

δ=R(k₀₀)×b₀₀+R(k₀₁)×b₀₁+R(k₀₂)×b₀₂ . . . +R(k_(m))×b_(m)  (3)

The compensation value ε is obtained by changing the signs of thedisplacement amount δ.

More specifically, as the corrective coefficient value obtained from theequation (3) is very small, 4194304 times of the corrective coefficientvalue is stored and the displacement amount δ is obtained from dividingthe calculated value by 4194304.

For instance, when compensating three axes X, Y and Z, the location readout from the corrective coefficient table are expressed as k₀₀, k₀₁, k₀₂. . . k_(m) the corrective coefficient in X axis corresponding to theabove location are b_(00x), b_(01x), b_(02x), . . . b_(mx), thecorrective coefficient in Y axis corresponding to the location areb_(00y), b_(01y), b_(02y), . . . b_(my), and the corrective coefficientin Z axis are b_(00z), b_(01z), b_(02z), . . . b_(mz). And the functionvalues of rotation frequency of the spindle at each location read outfrom the historical data table are expressed as R(k₀₀), R(k₀₁), R(k₀₂),. . . R(k_(m)). The displacement amounts for each axis δ_(X), δ_(y),δ_(z) can be obtained by the following equations.δ_(X)=(R(k₀₀)×b_(00x)+R(k₀₁)×b_(01x)+R(k₀₂)×b_(02x) . . .R(k_(m))×b_(mx))/4194304

δ_(y)=(R(k₀₀)×b_(00y)+R(k₀₁)×b_(01y)+R(k₀₂)×b_(02y) . . .R(k_(m))×b_(my))/4194304

δ_(z)=(R(k₀₀)×b_(00y)+R(k₀₁)×b_(01y)+R(k₀₂)×b_(02y) . . .R(k_(m))×b_(my))/4194304  (4)

A compensation value is a value of which absolute number is the same asthe displacement amount and which is shown in opposite signs. Therefore,compensation values for the axes (X, Y, and Z axis) ε_(x), ε_(y), ε_(z),are obtained from the following equation.

ε_(X)=−δ_(x), ε_(y)=−δ_(y), ε_(z)=−δ_(z)  (5)

Accordingly, the compensation value is calculated from the correctivecoefficient considering the rotation time, rotation frequency, elapsedtime of the spindle, and the function value of the spindle rotationfrequency. As the command position of the machine tool is compensatedbased on the compensation value, the displacement resulting fromcentrifugal force caused by the rotation of the spindle or heatgeneration spindle can be compensated with high accuracy even when thespindle is randomly rotated.

That is, in a conventional compensation method, the compensation valueis calculated based on a temperature difference at that time. When thespindle is randomly rotated, the compensation value for heatdisplacement of the spindle varies from small number to big number. Andit is impossible to compensate the displacement resulting from changesin rotation frequency of the spindle. But the apparatus according to thepresent invention gives a compensation value having little differencefrom the true displacement of the spindle even when the spindle isrotating at a random speed and also compensates a displacement caused bycentrifugal force. Thus the apparatus according to the present inventioncan achieve highly accurate compensation.

It is preferable that the function values are stored in the data tableat relatively short time intervals while the spindle is rotating and atrelatively long time intervals while the spindle is halted. Forinstance, the function values are stored at intervals from 20 seconds toone minute while the spindle is rotating and stored at intervals fromone minute to 3 minutes while the spindle is halted.

In this way, a precise compensation of the displacement can be achievedwith a single table while the spindle is rotated and also while thespindle is halted. Incidentally, displacement characteristics of thespindle in rotation is different from displacement characteristics ofthe spindle in suspension. If the function values are renewed and storedstill at the same time intervals, the compensation value derived maycontain some error. This may be considered as a disadvantage of themethod. But the method according to the present invention ensures anaccurate compensation of the displacement with one table for both inrotation and in suspension of the rotation of the spindle.

It is also preferable that the locations in the data table are arrangedin an order reverse to elapsed time.

Most of presently available micro processing units for the computer (itwill be abbreviated to MPU hereafter) are provided with a batch transferfunction of its memory contents. It takes shorter time for carrying outprocessing with the batch transfer function provided in the MPU than tomake and use programs of reading out individual data from a sourceaddress and writing in a destination address. But in this function, theprocessing is sequentially carried out from an address of a lower orderto higher order. Accordingly, when the range of address in sourceaddress is overlapped with the range of address in destination addressand if the destination address is in higher order than the order of thesource address, the overlapped range area can not be processedcorrectly. In the present invention, as the locations in the data tableare arranged in an order reverse to elapsed time, the above describedproblem can be avoided.

Moving averages(“ryu-do heikin” in Japanese) of the function values ofpredetermined plural locations in the past time period may be stored inthe data table at the time of data renewal, and one correctivecoefficient value in correspondence to the time period above describedmay be stored in the corrective coefficient table.

Then, the size (the number of lines) of the corrective coefficient tablecan be reduced and the speed for the compensation calculation can beimproved.

For the value stored in the historical data table, the rotationfrequency of the spindle itself can be used instead of the functionvalue of the spindle rotation frequency.

In such cases, the compensation procedure is as follows. A location inthe historical data table and the corresponding corrective coefficientare read out from the corrective coefficient table and at the same timethe rotation frequency of the spindle in the location is read out fromthe historical data table. The function values are calculated from therotation frequencies of the spindle in the locations as necessary. Andwith the corresponding corrective coefficients the calculations of thecorrective values are carried out. Then, the commanded position for eachshaft of the machine tool is compensated based on the corrective values.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram of the processing system showing an embodimentof the displacement compensation apparatus relating to the presentinvention;

FIG. 2 is a block diagram of a numeric control system for the aboveembodiment;

FIG. 3 is a corrective coefficients table for the above embodiment;

FIG. 4 is a block diagram showing the method of computations for thecorrective coefficient in the above embodiment;

FIG. 5 is a historical data table for the above embodiment;

FIG. 6 is a table after renewal of the historical data table for theabove embodiment;

FIG. 7 is a graph showing the relations among changes of the rotationfrequency of the spindle, the displacement amount obtained through thecompensation computations (compensation value) and measured values ofthe displacement in the above embodiment; and

FIG. 8 is a graph showing the relations between the compensation valuesobtained through the conventional compensation method and the measuredvalues.

BEST MODE FOR CARRYING OUT THE INVENTION

An embodiment of the present invention will now be explained in detailwith reference to the drawings.

FIG. 1 shows a processing system of the displacement compensationapparatus of the present invention. The processing system consists of ahorizontal boring machine 1 as a machine tool and a numeric control unit2 which controls the horizontal boring machine and also carries out theoperation of compensation.

The horizontal boring machine is constituted by a bed 11, a tableprovided on the bed 11 in a movable manner along the X-axis (directionsintersecting at right angles with the paper surface of FIG. 1), a column13 mounted and firmly fixed on the bed 11, a spindle head 14 provided tothe column 13 in a movable manner up and down along the Y-axis (the topand the bottom directions on FIG. 1), a ram 15 provided to the spindlehead 14 in a reciprocally movable manner along the Z-axis directions(right and left directions on FIG. 1) and a spindle 16 accommodated inthe ram in a rotatable manner. Incidentally, the designation 17 is amotor driving the spindle 16.

The numerical control unit 2 is provided with a CPU 21, a memory 22which stores various programs and data, a keyboard 23, a display 24, aprinter 25, and I/O 26, 27, 28, 29 as shown in FIG. 2. Each I/O 26, 27,28 is connected to the actuating systems toward X, Y, Z axis directionsof the horizontal boring machine, 18X, 18Y, 18Z and the I/O 29 isconnected with the motor 17. The CPU 21 controls movements of theactuating systems toward X, Y, Z directions 18X, 18Y, and 18Z andperforms compensation processing. Thus, the CPU 22 also serves as acompensation processing means.

The memory 22 is provided with not only a memory area for storingvarious processing programs (not shown in figures), but also acoordinate value table 22A which stores coordinate values of each axis(X, Y, Z), a compensation value table 22B which stores compensationvalues ε_(x), ε_(y), ε_(z) of each axis (X, Y, Z), a data table 22Dwhich stores a history of function values of the rotation frequency ofthe spindle on the machine tool in each time period from present to pastand a corrective coefficient table 22C which stores, in advance,corrective coefficients of each axes (X, Y, Z) relating the coefficientsto the addresses of the data table 22D.

The registration of the function value and the renewal of the history inthe data table 22D are carried out at intervals of 20 seconds to 3minutes. More specifically, the registration and renewal are carried outat intervals of 20 seconds to 1 minute when the spindle is rotating, andfrom 1 minute to 3 minutes when the rotation of the spindle issuspended. Thus, the history of the function values stored in the datatable 22D is memorized at intervals of a relatively short period of timewhile the spindle is rotating and at intervals of a relatively longperiod of time while the rotation of the spindle is suspended.

Here, FIG. 5 and FIG. 6 show the historical data table 22D. Forconvenience of explanation, assuming that the intervals of theregistration and renewal for the whole period is one minute, the elapsedtime is recorded in the elapsed-time column on FIG. 5 and FIG. 6. As amatter of fact, the elapsed time varies according to rotation orsuspension of the spindle, the actual elapsed time is not always thesame as shown in the figures.

Then, the randomly changeable elapsed time on the historical data table22D is each defined as X1, X2, X3, . . . X512.

As shown in FIG. 3, in relation to the addresses from k₅₁₂ to k₀₀(hereafter, they may be sometimes written as “from 512 to 0”) in thedata table 22D, the corrective coefficient of each axis in each timeperiod for every cycle of renewal from present to X4 ago,

(b_(00x), b_(00y), b_(00z)) (b_(01x), b_(01y), b_(01z)) . . . (b_(04x),b_(04y), b_(04z))

are stored in the corrective coefficient table 22C.

From X4 through X12 ago, the corrective coefficient of each axis in eachtime period at intervals of X2,

(b_(05x), b_(05y), b_(05z)) (b_(06x), b_(06y), b_(06z)) . . . (b_(08x),b_(08y), b_(08z))

are stored.

From X12 through X24 ago, the corrective coefficient of each axis ineach time period at intervals of X4,

(b_(09x), b_(09y), b_(09z)) (b_(10x), b_(10y), b_(10z)) (b_(11x),b_(11y), b_(11z))

are stored.

From X24 through X64 ago, the corrective coefficient of each axis ineach time period at intervals of X8,

(b_(12x), b_(12y), b_(12z)) (b_(13x), b_(13y), b_(13z)) . . . (b_(16x),b_(16y), b_(16z))

are stored.

From X64 through X128 ago, the corrective coefficient of each axis ineach time period at intervals of X16,

(b_(17x), b_(17y), b_(17z)) (b_(18x), b_(18y), b_(18z)) . . . (b_(20x),b_(20y), b_(20z))

are stored.

From X128 through X512 ago, the corrective coefficient of each axis ineach time period at intervals of X32,

(b_(21x), b_(21y), b_(21z)) (b_(22x), b_(22y), b_(22z)) . . . (b_(32x),b_(32y), b_(32z))

are stored.

In this point, the way to obtain the corrective coefficient stored inthe corrective coefficient table 22C is explained.

First, measured displacement values of top end portion of the spindle16, rotation time and rotation frequencies of the spindle 16 arecollected as data through experiments. In this point, in order to makeclear the relation between heat generation and heat emission of themachine, the rotation frequency of the spindle 16 is randomly changed(increasing or decreasing the rotation frequency).

For instance, the spindle 16 is rotated at a speed of 5000 rpm for 30minutes, 10000 rpm for an hour, 8000 rpm for 30 minutes, 15000 rpm foran hour, 5000 rpm for30 minutes and 15000 rpm for 30 minutes before itis stopped. The observation begins before the rotation is started andcontinues even after the rotation is halted until the displacement issubstantially recovered without interruption.

During the observation, the displacements of the spindle 16 in the X, Y,Z directions are measured at predetermined time intervals (for instance,every 30 seconds) and stored with the spindle rotation frequencies andthe time of the measurement.

Then, based on the data, each corrective coefficient is determined aftera multiple regression analysis.

Incidentally, the calculation of the multiple regression analysis iscarried out through the procedures shown in FIG. 4.

Initially, the function values of the spindle rotation frequency are setas independent variables. Here, as the amounts of change for one timeperiod in latest several times is large, a function value is set foreach time period during the latest several periods as an independentvariable. After the elapsed time exceeds X5, as the amount of change foreach time period becomes a little slow, an average of the functionvalues of the spindle rotation frequency between X2 is taken as anindependent variable. When the elapsed time exceeds X12, the change foreach time becomes slower, then an average of the function values of thespindle rotation frequency between X4is set as independent variable.Thus the time period for taking an average is extended according to thechange in displacement amount that gets slow with lapse of time. Atlast, an average between X32 from X481 to X512 is taken as thethirty-third independent variable.

The reason for using an average value of the function values asindependent variable is; 1. to reduce the number of the independentvariables and 2. to prevent confounding between the independentvariables.

In other words, when the number of the independent variables is large,the simultaneous equations with corresponding number of the independentvariables are required to be solved. Under present processingcircumstances of using a floating decimal, so-called double precision,the number of independent variables over seventy makes the calculationsuddenly difficult. The number of the independent variables ofthirty-three is about half of this number seventy and makes no problem.

Incidentally, the word “confounding” is used for a situation that adegree of correlation between independent variables becomes strongerthan the correlation between the independent variable and the dependentvariable. When the confounding occurs, a regression coefficient varieson a large scale with slight change in the data value. In the extreme,solutions to the simultaneous equations may not be obtained.

After setting measured values of the spindle displacement as dependentvariables, sum of products calculation is carried out. That is, for eachindependent variable and dependent variable, the sum and average arerespectively calculated, and the sum of products are obtained in eachrelations. The procedure is repeated as many times as the number of thedata.

Next, sum of products is calculated after data of the sum of products iscompensated by data of the sum. Then, coefficients of the simultaneousequations are determined. And after establishing criterion values forconvergence, the simultaneous equations are solved through Gauss's Lawof Discharge(sweeping. “Gausu-no-hakidashi-ho” in Japanese) so that theregression coefficients (corrective coefficients) are obtained andprinted. The procedure is repeated as many times as the number of theindependent variables. And the regression coefficients (correctivecoefficients) are printed.

As shown in FIG. 5, the history of the function values of the spindlerotation frequency for each time period from present to past in theaddress is stored from 512 to 0 of the historical data table 22D. Thecalculation of the function value of the spindle rotation frequency isbased on the equation (1).

Here, the method to store the function value of the spindle withrenewing the data table 22D one by one and at the same time calculatingthe moving averages(“ryu-do heikin” in Japanese) will be explained. FIG.6 shows the historical data table 22D after the renewal.

When power of the machine is turned on, as the spindle is not rotatingbefore then, the function values for all lapse of time are initializedto zeros. Then, following calculations (1), (2), (3) are repeatedlyperformed every time. And when the power is turned off, the renewal ofthe data table 22D can not be conducted during the suspension of thepower. But when the power is turned on again, the number of timescorresponding to the suspension are renewed. And if the time of thesuspension is longer than the period of the data table 22D, the functionvalues for all lapse of time are initialized to zeros just as in thecase of turning the power on.

(1) Calculation of the Sum

{circle around (1)} A function value in the address 507 and a functionvalue in the location number 508 are summed up and the total is storedin the memory A₂.

{circle around (2)} A function value in the address 497 and a functionvalue in the location number 499 are summed up and the total is storedin the memory A₄.

{circle around (3)} A function value in the address 481 and a functionvalue in the location number 485 are summed up and the total is storedin the memory A₈.

{circle around (4)} A function value in the address 433 and a functionvalue in the location number 441 are summed up and the total is storedin the memory A₁₆.

{circle around (5)} A function value in the address 353 and a functionvalue in the location number 369 are summed up and the total is storedin the memory A₃₂.

(2) Shift

Five hundred and twelve function values beginning from the address 1 areshifted to the address 0.

(3) Calculation of the Average

{circle around (1)} The value in the memory A₂ is divided by 2 and thequotient is written in the address 506.

{circle around (2)} The value in the memory A₄ is divided by 2 and thequotient is written in the address 496.

{circle around (3)} The value in the memory A₈ is divided by 2 and thequotient is written in the address 480.

{circle around (4)} The value in the memory A₁₆ is divided by 2 and thequotient is written in the address 432.

{circle around (5)} The value in the memory A₃₂ is divided by 2 and thequotient is written in the address 352.

Incidentally, many available micro processing units for the computer(hereafter, it will be called MPU for short) are provided with a batchtransfer function for its memory contents. It takes shorter time tocarry out processing with the batch transfer function provided in theMPU than to make and use programs of reading out individual data from asource address and write in a destination address. But in this function,the processing is sequentially carried out from an address of a lowerorder to higher order. Accordingly when the range of address in sourceaddress is overlapped with the range of address in destination addressand if the destination address is in a higher order than the order ofthe source address, the overlapped range area can not be processedcorrectly. To avoid this problem, the location numbers are allocated ina sequence reverse to the elapsed time in FIG. 5 and FIG. 6.

The effect of the embodiment of the present invention will be explainednext.

When power of the horizontal boring machine 1 and the numeric controlunit 2 is turned on and the horizontal boring machine 1 starts operatingthrough a command from the numeric control unit 2, the coordinate valuesof each shaft driving system 18X, 18Y, 18Z are renewed and stored in thecoordinate value table 22A and the function values of the rotationfrequency of the spindle 16 are stored in the historical data table 22D.

All the while, the compensation procedures are carried out at everypredetermined interval. The CPU 21 reads out each address and thecorrective coefficient from the corrective coefficient table 22C withreference to the time of performing the compensation, and reads out thefunction values of each shaft rotation frequency in the address of thedata table. After that, the CPU multiplies the function values of thespindle rotation frequency in the address and the correspondingcorrective coefficients and obtains through calculation the compensationvalues based on the total sum of each product.

When compensating the three axes X, Y, Z, assuming that the functionvalue of the spindle rotation frequency at the present time X0 relatedin the addresses from 512 to zero and the corresponding correctivecoefficients of each axis are R₅₁₂, b_(00x), b_(00y), b_(00z), thefunction value of the spindle rotation frequency at the period before X1and the corresponding corrective coefficients of each axis are R₅₁₁,b_(01X), b_(01y), b_(01Z), the function value of the spindle rotationfrequency at the period before X2 and the corresponding correctivecoefficients of each axis are R₅₁₀, b_(02x), b_(02y), b_(02z), . . . thefunction value of the spindle rotation frequency at the period before X5to X6 and the corresponding corrective coefficients of each axis areR₅₀₆, b_(05X), b_(05y), b₀₅, . . . and the function value of the spindlerotation frequency as of the period before X481 to X512 and thecorresponding corrective coefficients of each axis are R₀, b_(32X),b_(32y), b_(32Z), the amount of displacement for each axis, δ_(X),δ_(y, δ) _(Z) are calculated from the equation (4).

That is, the amount of displacement of δ_(X), δ_(Y), δ_(Z) is eachcalculated from following equations.

δ_(X)=(R₅₁₂×b_(00X)+R₅₁₁×b_(01X)+R₅₁₀×b_(02X) . . . +R₅₀₆×b_(05x) . . .+R₀×b_(32X)/4194304)

δ_(Y)=(R₅₁₂×b_(00y)+R₅₁₁×b_(01y)+R₅₁₀×b_(02y) . . . +R₅₀₆×b_(05y) . . .+R₀×b_(32y)/4194304)

δ_(Z)=(R₅₁₂×b_(00Z)+R₅₁₁×b_(01Z)+R₅₁₀×b_(02Z) . . . +R₅₀₆×b_(05Z) . . .+R₀×b_(32Z)/4194304)

The compensation values ε_(X) (=−δ_(X)), ε_(y) (=−δ_(y)), ε_(Z)(=−δ_(Z)) are calculated by substituting these displacement amountsδ_(X), δ_(y), and δ_(Z) into the equation (5).

For instance, when R₅₁₂, the function value of the spindle rotationfrequency at the present time X0, is 5104, b_(00X) the correspondingcoefficient of X axis, is −2687, b_(00y), the corresponding coefficientof Y axis, is −1080, and b_(00z), the corresponding coefficient of Zaxis, is 7450.

When R₅₁₁, the function value of the spindle rotation frequency at theperiod before X1, is 5104, b_(01X), the corresponding coefficient of Xaxis, is 2525, b_(01y), the corresponding coefficient of Y axis, is 425,and b_(01z), the corresponding coefficient of Z axis, is −6467.

When the function value of the spindle rotation frequency at the periodbefore X2, R₅₁₀ is 5104, the corresponding coefficient of X axis,b_(02x) is 1178, the corresponding coefficient of Y axis, b_(02y) is−206, and the corresponding coefficient of Z axis, b_(02z) is −3456.

When R₅₀₆, the function value of the spindle rotation frequency at theperiod from X5 to X6, is 3065, b_(05X), the corresponding coefficient ofX axis, is 223, b_(05y), the corresponding coefficient of Y axis, is2000, and b05z, the corresponding coefficient of Z axis, is −3120.

When R₀, the function value of the spindle rotation frequency at theperiod from X481 to X512, is 0, b_(32X), the corresponding coefficientof X axis, is 10, b_(32y), the corresponding coefficient of Y axis, is100, and b32z, the corresponding coefficient of Z axis, is −600. Ifthese situations are assumed, the displacement amounts of the axesδ_(X), δ_(y), δ_(Z) are calculated as follows.

δ_(X)=(5104×(−2687)+5104×2525+5104×1178 . . . +3065×223 . . .+0×10)/4194304 =10185628/4194304=2.428[μm]

δ_(y)=(5104×(−1080)+5104×425+5104×(−206) . . . +3065×2000 . . .+0×10)/4194304=23201458/4194304=5.532[μm]

δ_(z)=(5104×7450+5104×(−6467)+5104×(−3456) . . . +3065×(−3120) . . .+0×(−600)/4194304 =65685732/4194304=−15.661[μm]

Accordingly the compensation values ε_(X), ε_(y), ε_(Z) are as follows.

ε_(X)=−2.428[μm]

ε_(y)=−5.532[μm]

ε_(z)=15.661[μm]

In such a case that the corrective coefficient for the elapsed timecorresponding to the time shown in FIG. 5 is not found in FIG. 3, thecorresponding calculation is not given. For instance, the elapsed timecorresponding to the elapsed time (from X12 to X13) for address 499 isnot found in FIG. 3, the corresponding calculation is not given. But thevalue not used at that time will be used several times later due to theshift at every X1.

Thus, after the displacement amount in each axis δ_(X), δ_(y), δ_(Z) arecalculated from the function values of the spindle rotation frequencyR₅₁₂, R₅₁₁, R₅₁₀, . . . R₅₀₆ . . . R₀ for each time period from presentto past and each corrective coefficient corresponding to the aboveperiod of time

b_(00X), b_(01X), b_(02X), . . . b_(05X) . . . b_(32x)

b_(00y), b_(01y), b_(02y), . . . b_(05y) . . . b_(32y)

b_(00Z), b_(01Z), b_(02Z), . . . b_(05Z) . . . b_(32Z)

the compensation values for each axis ε_(X), ε_(y), ε_(Z) are obtainedby reversing the signs of the displacement amount δ_(X),δ_(y), δ_(Z).These compensation values ε_(X), ε_(y), ε_(Z) are renewed and memorizedin the compensation table 22B.

Then, the NC command position commanded after the renewal is adjusted bythe amount of compensation values ε_(X), ε_(y), ε_(Z) in thecompensation value table 22B and the displacement amount in each axis iscompensated by using the compensation value ε_(X), ε_(y), ε_(Z)memorized in the compensation value table 22B.

In the embodiment of the present invention, a history of function valuesof the spindle in each time period from present to past are stored inthe historical data table 22D, and the corrective coefficients arestored in advance in the corrective coefficient table 22C relating thecoefficients to the address in the historical data table 22D. Incompensation procedure, the address and the corrective coefficient areread out from the corrective coefficient table and the function value ofthe spindle rotation frequency corresponding to each address is read outfrom the data table 22D. The compensation value is calculated from thefunction value of the spindle rotation frequency at the correspondingaddress and corrective coefficient corresponding to this functionnumber. Thus, as the NC command position is compensated based on thiscompensation value, even when the spindle 16 is randomly rotated, thedisplacement resulting from centrifugal force and heat generation causedby rotation of the spindle 16 can be compensated accurately.

For instance, when the spindle is rotated in a condition shown in FIG.7(A), the measured displacement values of three axis X, Y, Z and thedisplacement amounts of each axis obtained from the compensationcalculation in the embodiment of the present invention δ_(X)(=−ε_(X)),δ_(y) (=−ε_(y)),δ_(z) (=−ε_(z)), are shown in FIG. (B), FIG.(C), and FIG. (D). As is clear from these figures, each displacementamounts δ_(X) (=−ε_(X)),δ_(y) (=−ε_(y)), and δ_(z) (=−ε_(z)) are veryclose to the measured values of displacement with little error, and itis apparent that the compensations of the NC command position based onthe compensation values can achieve a high accuracy compensation, evenwhen the spindle is randomly rotated.

The calculation of the compensation values ε_(X), ε_(Y), ε_(Z) areobtained from the following procedures. Assuming that the functionvalues of the spindle in each time period from present to past are R₅₁₂,R₅₁₁, R₅₁₀, . . . R₅₀₆. . . R₀, the corrective coefficients are b_(00X),b_(01X), b_(02X), . . . b_(32X), b_(00y), b_(01y), b_(02y), . . .b_(05y), b_(32y), b_(00Z), b_(01Z), b_(02Z), . . . b_(05Z) . . .b_(32Z), the displacement amounts δ_(X), δ_(Y), δ_(Z) are calculatedfrom,

δ_(X)=(R₅₁₂×b_(00X)+R₅₁₁×b_(01X)+R₅₁₀×b_(02X) . . . +R₅₀₆×b_(05X) . . .+R₀×b_(32X)/4194304

δ_(y)=(R₅₁₂×b_(00y)+R₅₁₁×b_(01y+R) ₅₁₀×b_(02y) . . . +R₅₀₆×b_(05y) . . .+R₀×b_(32y)/4194304

δ_(Z)=(R₅₁₂×b_(00Z)+R₅₁₁×b_(01Z)+R₅₁₀×b_(02Z) . . . +R₅₀₆×b_(05Z) . . .+R₀×b_(32Z)/4194304

Then, the compensation values ε_(X), ε_(y), εZ_(Z) are obtained bychanging the sign of the displacement amounts δ_(x), δ_(y), δ_(z). Thusthe compensation values ε_(x), ε_(y), ε_(z) can be obtained by such avery simple calculation.

With regard to X axis, for instance, the corrective coefficientsb_(00X), b_(01X), . . . b_(04X) corresponding to each X1 time periodfrom present before X4, corrective coefficients b_(05X), b_(06X), . . .b_(08X), corresponding to every X2 time period from X4before X12,corrective coefficients b_(09X), b_(10X), b_(11X) corresponding to everyX4time period from X12 before X24, corrective coefficients b_(12X),b_(13X), . . . b_(16X) corresponding to every X8 time period from X24before X64, corrective coefficients b_(17X), b_(18X), . . . b_(20X)corresponding to every X16 time period from X64 before X128, correctivecoefficients b_(21X), b_(22X), . . . b_(32X) corresponding to every X32from X128 before X512 are respectively stored in the correctivecoefficient table 22C. In other words, as the period of time becomesfarther back, the corrective coefficient is taken with longer intervals,thus the corrective coefficients can be stored with a small memorycapacity.

And as a value proportional to a square of the main valve rotationfrequency, or a compensated value based on a value proportional to asquare of the main valve rotation frequency with a compensation by othervalue, is used as a function value of the spindle rotation frequency tostore in the historical data table 22D, a displacement resulting fromcentrifugal force and heat generation caused by the rotation of thespindle 16.

In the above described embodiment, the corrective coefficients arestored in every X1 from present till X4, and the corrective coefficientsare stored in every X2 from more than X4 till X12, in every X4 from morethan X12 till X24, in every X8 from more than X 24 till 64, in every X16from more than X64 till X128, and in every X32 from more than X128 tillX512 are respectively stored. But the time period for the correctivecoefficients is not limited within the period written above, and anyoptional period of time may be used for storing the correctivecoefficient.

For instance, if a method of storing the corrective coefficients inevery one minute from zero minute to 512 minutes ago, is adopted, thecorrective coefficient table 22C needs more than 15 times as large amemory capacity and also needs more than 15 times as large amultiplication and addition circuit to calculate the displacement amountand the compensation value. But the advantage is that the aforementionedcalculation of the sum (1) and calculation of the average isunnecessary, and the program for the compensation is simplified.

In the above described embodiment, the compensation value is calculatedusing the function value of the spindle rotation frequency, but directuse of the spindle rotation frequency for the calculation also givescompensation values with improved accuracy than that of the conventionalheat displacement compensation method.

By the heat displacement compensation apparatus of machine toolsaccording to the present invention, displacement resulting fromcentrifugal force and heat generation caused by rotation of the spindle,can be compensated with high accuracy, even when the spindle is randomlyrotated.

Industrial availability

The present invention is best suited for compensating the displacementresulting from rotation of the spindle of a machine tool such as ahorizontal boring machine and a milling machine which uses rotation ofthe spindle for processing.

What is claimed is:
 1. A displacement compensation apparatus for machinetools to compensate the displacements that occurs from centrifugal forceor heat generation caused by the rotation of a spindle in a machinetool, comprising: a history file of data table which stores functionvalues of the spindle rotation frequency in a plurality of time periodsfrom present to past; a corrective coefficient table in which correctioncoefficients are stored in a compensation process means, and whereinsaid compensation process means is for reading out each location and thecorrective coefficient corresponding to each location from thecorrective coefficient table, concurrently reading out the functionvalue for the spindle rotational frequency at each location from thehistorical data table, calculating a compensation value from thefunction value at each location and the corresponding correctivecoefficient, and compensating a command position of each shaft in themachine based on the calculated compensation values.
 2. The displacementcompensation apparatus for machine tools according to claim 1, whereinsaid compensation process means determines the compensation value ε bychanging signs of displacement amounts δ calculated from the followingequation δ=R(k₀₀)×b₀₀+R(k₀₁)×b₀₁+R(k₀₂)×b₀₂ . . . +R(k_(m))×b_(m) wherek₀₀, k₀₁, k₀₂ . . . k_(m) is location respectively read out from saidcorrective coefficient table, b₀₀, b₀₁, b₀₂, . . . b_(m) is eachcorrective coefficient corresponding to the location, and the functionvalue of the spindle rotation frequency in each location read from thehistorical data table is R(k₀₀), R(k₀₁), R(k₀₂) . . . R(k_(m)).
 3. Thedisplacement compensation apparatus for machine tools according to anyone of claims 1 or 2, wherein said corrective coefficient is determinedby collecting and memorizing measured data of displacement of thespindle, shaft rotation time data and rotation frequency data while thespindle is rotated with randomly changing the rotation frequency of thespindle and by processing regression calculations based on the data. 4.The displacement compensation apparatus for machines tools according toclaim 1, wherein said function value is a value proportional to thesquare of the spindle rotation frequency, or a value based on the valueproportional to the square of the spindle rotation frequency with acompensation by another value.
 5. The displacement compensationapparatus for machine tools according to claim 1, wherein the history ofthe function value in said historical data table is memorized atintervals of a relatively short period of time while the spindle is inrotation and at intervals of a relatively long period of time while therotation of the spindle is suspended.
 6. The displacement compensationapparatus for machine tools according to claim 1, wherein said locationsin the historical data table are arranged in an order reverse to elapsedtime.
 7. The displacement compensation apparatus for machine toolsaccording to claim 1, wherein a moving average of the function values ata plurality of predetermined locations during a certain past period oftime is stored in said historical data at a data renewal; and wherein acorrective coefficient corresponding to the above period of time isstored in said corrective coefficient table.
 8. The displacementcompensation apparatus for machine tools according to claim 1, whereinthe rotation frequency of the spindle is used instead of the functionvalue of the rotation frequency of the spindle for calculating thecompensation value.